<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>网站后台管理系统</title>
	<%@ include file="/page/common/common.jsp" %>	
	<script type="text/javascript">

	//为了避免SEESION过期后登录窗口在iframe中出现的情况
	if(window.parent.location.href.indexOf('/page/index.jsp')!=-1){
		alert('会话过期，请重新登录');
		window.parent.location.href='${ctx}/page/login.jsp';
	}
	
		$(function(){
			//回车键触发登录
			$("body").keydown(function(event){
				if(event.keyCode==13)
					login();
			});
		});
	
	function login(){
		var r = $('#loginForm').form('validate');
		if(!r) {
			return false;
		}
		var url="${ctx}/super/admin/login.adm";
		var param = "adminName="+$('#adminName').val();
		param += "&adminPassword="+$('#adminPwd').val();
		$.post(url,param,function(data){
		//$('#loginForm').form('clear');
			if(data.success){//操作成功
				location.href="${ctx}/page/index.jsp";	
			}else{
				$.messager.alert('提示',data.msg,'warning');	
			}
		});
	}
	</script>
</head>
<body style="visibility:visible">
	<div class="easyui-dialog" style="width:500px;height:300px;background:#fafafa;overflow:hidden"
			title="登录系统" closable="false" border="false">
		<div class="logintop" style="height:60px;">
			<div class="toptitle">后台管理系统</div>
		</div>
		<div style="padding:60px 0;">
			<form id="loginForm" method="post">
				<div style="padding-left:150px">
					<table cellpadding="0" cellspacing="3">
						<tr>
							<td>登录帐号：</td>
							<td><input name="adminName" id="adminName" style="width: 130px;"/></td>
						</tr>
						<tr>
							<td>登录密码：</td>
							<td><input type="password" id="adminPwd" name="password" style="width: 130px;"/></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td></td>
						</tr>
						<tr>
							<td></td>
							<td>
								<input class="loginbtn" type="button" onclick="login();" value=""/>
							</td>
						</tr>
					</table>
				</div>
				
			</form>
		</div>
	</div>
</body>
</html>